package study.Service.Impl;

import study.Service.UserService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 *
 * @author Ychiha
 * @version 1.0
 * @date 11/1/2022 上午9:16
 */
public class UserServiceImpl implements UserService {

    @Override
    public String PasswordEncode(String RawPassword) {
        PasswordEncoder pe = new BCryptPasswordEncoder();
        String encode = pe.encode(RawPassword);
        System.out.println(encode);
        if(pe.matches(RawPassword,encode)){
            return encode;
        }else{
            return "";
        }
    }
}
